[MTR04] W2 D12 練習三


Posted by Christy on 2020-07-16

練習三:寫一個能夠印出 n 個 的函式
寫一個函式 star,接收一個參數 n,並印出 n 個

(禁止使用內建函式 repeat)

star(1) 預期輸出:
*

star(5) 預期輸出:


star(10) 預期輸出:


function star(n){
 for (i = 1; i<=n; i++) {
}
console.log(star(1))

中間少了星星,應該有要擺的地方,明天繼續研究。










Related Posts

React Hooks - Day4

React Hooks - Day4

智能合約(二) - 撰寫智能合約的程式語言

智能合約(二) - 撰寫智能合約的程式語言

原型鏈(Prototype Chain)

原型鏈(Prototype Chain)


Comments